<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>EquTemper: ETSheet.cc Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="$relpath<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="$relpath<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>/search.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<div id="top"><!-- do not remove this div! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">EquTemper&#160;<span id="projectnumber">1.01</span></div>
   <div id="projectbrief">An equation editor.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<script type="text/javascript">
function hasClass(ele,cls) {
  return ele.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)'));
}

function addClass(ele,cls) {
  if (!this.hasClass(ele,cls)) ele.className += " "+cls;
}

function removeClass(ele,cls) {
  if (hasClass(ele,cls)) {
    var reg = new RegExp('(\\s|^)'+cls+'(\\s|$)');
    ele.className=ele.className.replace(reg,' ');
  }
}

function toggleVisibility(linkObj) {
 var base = linkObj.getAttribute('id');
 var summary = document.getElementById(base + '-summary');
 var content = document.getElementById(base + '-content');
 var trigger = document.getElementById(base + '-trigger');
 if ( hasClass(linkObj,'closed') ) {
   summary.style.display = 'none';
   content.style.display = 'block';
   trigger.src = 'open.png';
   removeClass(linkObj,'closed');
   addClass(linkObj,'opened');
 } else if ( hasClass(linkObj,'opened') ) {
   summary.style.display = 'block';
   content.style.display = 'none';
   trigger.src = 'closed.png';
   removeClass(linkObj,'opened');
   addClass(linkObj,'closed');
 }
 return false;
}
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
      <li id="searchli">
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('_e_t_sheet_8cc.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">ETSheet.cc</div>  </div>
</div>
<div class="contents">
<a href="_e_t_sheet_8cc.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* ========================================================================= */</span>
<a name="l00002"></a>00002 <span class="comment">/* ------------------------------------------------------------------------- */</span><span class="comment"></span>
<a name="l00003"></a>00003 <span class="comment">/*!</span>
<a name="l00004"></a>00004 <span class="comment">  \file         ETSheet.cc</span>
<a name="l00005"></a>00005 <span class="comment">  \date         september 2011</span>
<a name="l00006"></a>00006 <span class="comment">  \author       TNick</span>
<a name="l00007"></a>00007 <span class="comment"></span>
<a name="l00008"></a>00008 <span class="comment">  \brief        Contains the implementation for ETSheet class</span>
<a name="l00009"></a>00009 <span class="comment"></span>
<a name="l00010"></a>00010 <span class="comment"></span>
<a name="l00011"></a>00011 <span class="comment">  Copyright (c) 2011, Nicu Tofan</span>
<a name="l00012"></a>00012 <span class="comment"> All rights reserved.</span>
<a name="l00013"></a>00013 <span class="comment"></span>
<a name="l00014"></a>00014 <span class="comment"> Redistribution and use in source and binary forms, with or without</span>
<a name="l00015"></a>00015 <span class="comment"> modification, are permitted provided that the following conditions are met:</span>
<a name="l00016"></a>00016 <span class="comment"> * Redistributions of source code must retain the above copyright</span>
<a name="l00017"></a>00017 <span class="comment">   notice, this list of conditions and the following disclaimer.</span>
<a name="l00018"></a>00018 <span class="comment"> * Redistributions in binary form must reproduce the above copyright</span>
<a name="l00019"></a>00019 <span class="comment">   notice, this list of conditions and the following disclaimer in the</span>
<a name="l00020"></a>00020 <span class="comment">   documentation and/or other materials provided with the distribution.</span>
<a name="l00021"></a>00021 <span class="comment"> * Neither the name of the copyright holder nor the</span>
<a name="l00022"></a>00022 <span class="comment">   names of its contributors may be used to endorse or promote products</span>
<a name="l00023"></a>00023 <span class="comment">   derived from this software without specific prior written permission.</span>
<a name="l00024"></a>00024 <span class="comment"></span>
<a name="l00025"></a>00025 <span class="comment"> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS &quot;AS IS&quot; AND</span>
<a name="l00026"></a>00026 <span class="comment"> ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED</span>
<a name="l00027"></a>00027 <span class="comment"> WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE</span>
<a name="l00028"></a>00028 <span class="comment"> DISCLAIMED. IN NO EVENT SHALL NICU TOFAN BE LIABLE FOR ANY</span>
<a name="l00029"></a>00029 <span class="comment"> DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES</span>
<a name="l00030"></a>00030 <span class="comment"> (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;</span>
<a name="l00031"></a>00031 <span class="comment"> LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND</span>
<a name="l00032"></a>00032 <span class="comment"> ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT</span>
<a name="l00033"></a>00033 <span class="comment"> (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS</span>
<a name="l00034"></a>00034 <span class="comment"> SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span>
<a name="l00035"></a>00035 <span class="comment"></span>
<a name="l00036"></a>00036 <span class="comment">*/</span>
<a name="l00037"></a>00037 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00038"></a>00038 <span class="comment">/* ========================================================================= */</span>
<a name="l00039"></a>00039 <span class="comment">//</span>
<a name="l00040"></a>00040 <span class="comment">//</span>
<a name="l00041"></a>00041 <span class="comment">//</span>
<a name="l00042"></a>00042 <span class="comment">//</span>
<a name="l00043"></a>00043 <span class="comment">/*  INCLUDES    ------------------------------------------------------------ */</span>
<a name="l00044"></a>00044 
<a name="l00045"></a>00045 <span class="preprocessor">#include    &lt;<a class="code" href="main_8h.html" title="Contains global definitions for application.">main.h</a>&gt;</span>
<a name="l00046"></a>00046 
<a name="l00047"></a>00047 <span class="preprocessor">#include    &lt;QDomDocument&gt;</span>
<a name="l00048"></a>00048 <span class="preprocessor">#include    &lt;QMessageBox&gt;</span>
<a name="l00049"></a>00049 <span class="preprocessor">#include    &lt;QApplication&gt;</span>
<a name="l00050"></a>00050 
<a name="l00051"></a>00051 <span class="preprocessor">#include    &lt;<a class="code" href="mainwindow_8h.html" title="Contains the definition for MainWindow class.">gui/mainwindow.h</a>&gt;</span>
<a name="l00052"></a>00052 <span class="preprocessor">#include    &lt;<a class="code" href="mdichild_8h.html" title="Contains the definition for MdiChild class.">gui/mdichild.h</a>&gt;</span>
<a name="l00053"></a>00053 
<a name="l00054"></a>00054 <span class="preprocessor">#include    &lt;<a class="code" href="_e_t_i___cplx_txt_8h.html" title="Contains the definition for ETI_CplxTxt class.">sheet/ETI_CplxTxt.h</a>&gt;</span>
<a name="l00055"></a>00055 <span class="preprocessor">#include    &lt;<a class="code" href="_e_t_i___m_txt_8h.html" title="Contains the definition for ETI_MTxt class.">sheet/ETI_MTxt.h</a>&gt;</span>
<a name="l00056"></a>00056 <span class="preprocessor">#include    &lt;<a class="code" href="_e_t_sheet_view_8h.html" title="Contains the definition for ETSheetView class.">sheet/ETSheetView.h</a>&gt;</span>
<a name="l00057"></a>00057 
<a name="l00058"></a>00058 <span class="preprocessor">#include    &quot;<a class="code" href="_e_t_sheet_8h.html" title="Contains the definition for ETSheet class.">ETSheet.h</a>&quot;</span>
<a name="l00059"></a>00059 
<a name="l00060"></a>00060 <span class="comment">/*  INCLUDES    ============================================================ */</span>
<a name="l00061"></a>00061 <span class="comment">//</span>
<a name="l00062"></a>00062 <span class="comment">//</span>
<a name="l00063"></a>00063 <span class="comment">//</span>
<a name="l00064"></a>00064 <span class="comment">//</span>
<a name="l00065"></a>00065 <span class="comment">/*  CLASS    --------------------------------------------------------------- */</span>
<a name="l00066"></a>00066 <a class="code" href="ddhc__main_8h.html#abeddf5a2c22a7727d1c96c148d05d9cf">DDHC_CONTENT</a>(<a class="code" href="class_e_t_sheet.html" title="Class representing logical root for all elements contained in a document (sheet)">ETSheet</a>)
<a name="l00067"></a>00067 QList&lt;<a class="code" href="class_e_t_sheet.html" title="Class representing logical root for all elements contained in a document (sheet)">ETSheet</a>*&gt;     <a class="code" href="class_e_t_sheet.html" title="Class representing logical root for all elements contained in a document (sheet)">ETSheet</a>::invisible_list;
<a name="l00068"></a>00068 
<a name="l00069"></a>00069 
<a name="l00070"></a>00070 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00071"></a><a class="code" href="class_e_t_sheet.html#adf5b1eb82b5c396462e35b7de088b1f5">00071</a> <a class="code" href="class_e_t_sheet.html" title="Class representing logical root for all elements contained in a document (sheet)">ETSheet</a>::<a class="code" href="class_e_t_sheet.html" title="Class representing logical root for all elements contained in a document (sheet)">ETSheet</a>    (QObject * parent)
<a name="l00072"></a>00072     : QGraphicsScene (parent),
<a name="l00073"></a>00073       hd_ur(this)
<a name="l00074"></a>00074 {
<a name="l00075"></a>00075     <a class="code" href="ddhc__main_8h.html#a5450dfe3c644f059533fb6b0a704d9bf">DDHC_CONSTRUCT</a>;
<a name="l00076"></a>00076     <a class="code" href="ddhc__main_8h.html#abe1f2d96d3d620116d512432989392b3">DDHC_VARIABLE</a>(back_col);
<a name="l00077"></a>00077     <span class="comment">//    DDHC_NODE(&amp;cl_inst);</span>
<a name="l00078"></a>00078     <span class="comment">//    DDHC_NODE(&amp;cl_another_inst);</span>
<a name="l00079"></a>00079     <a class="code" href="ddhc__main_8h.html#abe1f2d96d3d620116d512432989392b3">DDHC_VARIABLE</a>(vp_crt);
<a name="l00080"></a>00080     <span class="comment">//  DDHC_VARIABLE(&amp;hd_ur);</span>
<a name="l00081"></a>00081     <a class="code" href="ddhc__main_8h.html#abe1f2d96d3d620116d512432989392b3">DDHC_VARIABLE</a>(mdi_cont);
<a name="l00082"></a>00082 
<a name="l00083"></a>00083 
<a name="l00084"></a>00084 
<a name="l00085"></a>00085     vp_crt = <a class="code" href="aclass__ddhc_8cc.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>;
<a name="l00086"></a>00086     mdi_cont = <a class="code" href="aclass__ddhc_8cc.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>;
<a name="l00087"></a>00087     back_col = QColor(Qt::yellow);
<a name="l00088"></a>00088 
<a name="l00089"></a>00089 }
<a name="l00090"></a>00090 <span class="comment">/* ========================================================================= */</span>
<a name="l00091"></a>00091 
<a name="l00092"></a>00092 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00093"></a><a class="code" href="class_e_t_sheet.html#a86b2acf32c8edadd4125846bf148ae30">00093</a> <a class="code" href="class_e_t_sheet.html#a86b2acf32c8edadd4125846bf148ae30" title="destructor">ETSheet::~ETSheet</a>   ( <span class="keywordtype">void</span> )
<a name="l00094"></a>00094 {
<a name="l00095"></a>00095     <span class="keywordflow">if</span> (<a class="code" href="class_e_t_sheet.html#a2915c8ae289ed5b5a77ae871af964884" title="associated MDI panel">mdi_cont</a> != <a class="code" href="aclass__ddhc_8cc.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>)
<a name="l00096"></a>00096         {
<a name="l00097"></a>00097             <a class="code" href="class_mdi_child.html" title="form representing a document inside MDI area">MdiChild</a> * tmp = <a class="code" href="class_e_t_sheet.html#a2915c8ae289ed5b5a77ae871af964884" title="associated MDI panel">mdi_cont</a>;
<a name="l00098"></a>00098             <a class="code" href="class_e_t_sheet.html#a2915c8ae289ed5b5a77ae871af964884" title="associated MDI panel">mdi_cont</a> = <a class="code" href="aclass__ddhc_8cc.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>;
<a name="l00099"></a>00099             tmp-&gt;close();
<a name="l00100"></a>00100             tmp-&gt;deleteLater();
<a name="l00101"></a>00101         }
<a name="l00102"></a>00102     <span class="keywordflow">else</span>
<a name="l00103"></a>00103         {
<a name="l00104"></a>00104         <span class="keywordtype">int</span> i = <a class="code" href="class_e_t_sheet.html#a60207c5a593d551047a5cb16606d69fe" title="list of invisible documents">invisible_list</a>.indexOf(<span class="keyword">this</span>);
<a name="l00105"></a>00105         <span class="keywordflow">if</span> (i &gt;= 0)
<a name="l00106"></a>00106             {
<a name="l00107"></a>00107                 <a class="code" href="class_e_t_sheet.html#a60207c5a593d551047a5cb16606d69fe" title="list of invisible documents">invisible_list</a>.removeAt(i);
<a name="l00108"></a>00108             }
<a name="l00109"></a>00109         }
<a name="l00110"></a>00110 
<a name="l00111"></a>00111     <a class="code" href="ddhc__main_8h.html#a83b4d50889e49e105c89d71acff6f975">DDHC_DESTRUCT</a>
<a name="l00112"></a>00112 }
<a name="l00113"></a>00113 <span class="comment">/* ========================================================================= */</span>
<a name="l00114"></a>00114 
<a name="l00115"></a>00115 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00116"></a><a class="code" href="class_e_t_sheet.html#a33893d440e3859fbeee49088b7194406">00116</a> <a class="code" href="class_e_t_sheet.html" title="Class representing logical root for all elements contained in a document (sheet)">ETSheet</a> *       <a class="code" href="class_e_t_sheet.html#a33893d440e3859fbeee49088b7194406" title="creates a new sheet; it is invisible to the user">ETSheet::newInvisible</a>           (
<a name="l00117"></a>00117     QString s_file, QString * s_err )
<a name="l00118"></a>00118 {
<a name="l00119"></a>00119     s_err-&gt;clear();
<a name="l00120"></a>00120     <a class="code" href="class_e_t_sheet.html" title="Class representing logical root for all elements contained in a document (sheet)">ETSheet</a> * new_sht = <span class="keyword">new</span> <a class="code" href="class_e_t_sheet.html#adf5b1eb82b5c396462e35b7de088b1f5" title="constructor">ETSheet</a>();
<a name="l00121"></a>00121 
<a name="l00122"></a>00122     <span class="keywordflow">if</span> (!s_file.isEmpty())
<a name="l00123"></a>00123         {
<a name="l00124"></a>00124             new_sht-&gt;<a class="code" href="class_e_t_sheet.html#a17384eea523b013c593abf6be0e73623" title="add the content of a xml file to current sheet">loadXMLFile</a>(s_file);
<a name="l00125"></a>00125         }
<a name="l00126"></a>00126 
<a name="l00127"></a>00127     <a class="code" href="class_e_t_sheet.html#a60207c5a593d551047a5cb16606d69fe" title="list of invisible documents">invisible_list</a>.append(new_sht);
<a name="l00128"></a>00128     <span class="keywordflow">return</span> new_sht;
<a name="l00129"></a>00129 }
<a name="l00130"></a>00130 <span class="comment">/* ========================================================================= */</span>
<a name="l00131"></a>00131 
<a name="l00132"></a>00132 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00133"></a><a class="code" href="class_e_t_sheet.html#ae46162fde47b4dca8bd8788435dcbfbf">00133</a> <a class="code" href="class_e_t_sheet.html" title="Class representing logical root for all elements contained in a document (sheet)">ETSheet</a> *       <a class="code" href="class_e_t_sheet.html#ae46162fde47b4dca8bd8788435dcbfbf" title="creates a new sheet; it is visible to the user">ETSheet::newVisible</a>             (
<a name="l00134"></a>00134     QString s_file, <a class="code" href="class_mdi_child.html" title="form representing a document inside MDI area">MdiChild</a> * asoc_w)
<a name="l00135"></a>00135 {
<a name="l00136"></a>00136     QApplication::setOverrideCursor(Qt::WaitCursor);
<a name="l00137"></a>00137 
<a name="l00138"></a>00138     <a class="code" href="class_e_t_sheet.html" title="Class representing logical root for all elements contained in a document (sheet)">ETSheet</a> * new_sht = <span class="keyword">new</span> <a class="code" href="class_e_t_sheet.html#adf5b1eb82b5c396462e35b7de088b1f5" title="constructor">ETSheet</a>();
<a name="l00139"></a>00139     new_sht-&gt;<a class="code" href="class_e_t_sheet.html#a2915c8ae289ed5b5a77ae871af964884" title="associated MDI panel">mdi_cont</a> = asoc_w;
<a name="l00140"></a>00140 
<a name="l00141"></a>00141     <span class="keywordflow">if</span> (!s_file.isEmpty())
<a name="l00142"></a>00142         {
<a name="l00143"></a>00143             new_sht-&gt;<a class="code" href="class_e_t_sheet.html#a17384eea523b013c593abf6be0e73623" title="add the content of a xml file to current sheet">loadXMLFile</a>(s_file);
<a name="l00144"></a>00144         }
<a name="l00145"></a>00145     <span class="keywordflow">else</span>
<a name="l00146"></a>00146         {
<a name="l00147"></a>00147             new_sht-&gt;<a class="code" href="class_e_t_sheet.html#a0ecdc80038e1ae878c6846df4c129632" title="current viewport">vp_crt</a> = <span class="keyword">new</span> <a class="code" href="class_e_t_sheet_view.html" title="Widget capable of displaying an ETSheet content.">ETSheetView</a>(new_sht, new_sht-&gt;<a class="code" href="class_e_t_sheet.html#a2915c8ae289ed5b5a77ae871af964884" title="associated MDI panel">mdi_cont</a>);
<a name="l00148"></a>00148             new_sht-&gt;<a class="code" href="class_e_t_sheet.html#a2915c8ae289ed5b5a77ae871af964884" title="associated MDI panel">mdi_cont</a>-&gt;setWidget(new_sht-&gt;<a class="code" href="class_e_t_sheet.html#a0ecdc80038e1ae878c6846df4c129632" title="current viewport">vp_crt</a>);
<a name="l00149"></a>00149         }
<a name="l00150"></a>00150 
<a name="l00151"></a>00151     QApplication::restoreOverrideCursor();
<a name="l00152"></a>00152     <span class="keywordflow">return</span> new_sht;
<a name="l00153"></a>00153 }
<a name="l00154"></a>00154 <span class="comment">/* ========================================================================= */</span>
<a name="l00155"></a>00155 
<a name="l00156"></a>00156 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00157"></a><a class="code" href="class_e_t_sheet.html#a531636a8b9b9841afc65ec1bc9c60b66">00157</a> <span class="keywordtype">int</span>             <a class="code" href="class_e_t_sheet.html#a531636a8b9b9841afc65ec1bc9c60b66" title="tells the number of visible documents">ETSheet::visibleCount</a>           ( <span class="keywordtype">void</span> )
<a name="l00158"></a>00158 {
<a name="l00159"></a>00159     <span class="keywordflow">return</span> <a class="code" href="main_8cc.html#ac217449d3d899f76481b08cf3cc9acc0" title="hold pointer to main gui object in global variable for easy access">g_MW</a>-&gt;<a class="code" href="class_main_window.html#acacaa70bd83d119e313cb460b96ce078" title="number of opened documents at this time">docsOpened</a>();
<a name="l00160"></a>00160 }
<a name="l00161"></a>00161 <span class="comment">/* ========================================================================= */</span>
<a name="l00162"></a>00162 
<a name="l00163"></a>00163 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00164"></a><a class="code" href="class_e_t_sheet.html#a7ec304bc04c8ebe8e6d7ba5eff984018">00164</a> <a class="code" href="class_e_t_sheet.html" title="Class representing logical root for all elements contained in a document (sheet)">ETSheet</a> *       <a class="code" href="class_e_t_sheet.html#a7ec304bc04c8ebe8e6d7ba5eff984018" title="get the visible document with index doc_index ">ETSheet::visibleDoc</a>             (<span class="keywordtype">int</span> doc_index)
<a name="l00165"></a>00165 {
<a name="l00166"></a>00166     <a class="code" href="class_mdi_child.html" title="form representing a document inside MDI area">MdiChild</a> * mdi_kid = <a class="code" href="main_8cc.html#ac217449d3d899f76481b08cf3cc9acc0" title="hold pointer to main gui object in global variable for easy access">g_MW</a>-&gt;<a class="code" href="class_main_window.html#ab0526819ffdc1960d8dbbfd85e1af2d2" title="document having the index doc_idx">docByIndex</a>(doc_index);
<a name="l00167"></a>00167     <span class="keywordflow">if</span> (mdi_kid == <a class="code" href="aclass__ddhc_8cc.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>)
<a name="l00168"></a>00168         <span class="keywordflow">return</span> <a class="code" href="aclass__ddhc_8cc.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>;
<a name="l00169"></a>00169     <span class="keywordflow">return</span> mdi_kid-&gt;<a class="code" href="class_mdi_child.html#aabb7ee0d4a15f4e2631106a0af3787ef" title="tell the associated sheet object">assocDoc</a>();
<a name="l00170"></a>00170 }
<a name="l00171"></a>00171 <span class="comment">/* ========================================================================= */</span>
<a name="l00172"></a>00172 
<a name="l00173"></a>00173 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00174"></a><a class="code" href="class_e_t_sheet.html#a99ededfa6ed80849580d2b9fe797661a">00174</a> <a class="code" href="class_e_t_i___cplx_txt.html" title="class representing a complex text; this may or may not represent an equation">ETI_CplxTxt</a> *   <a class="code" href="class_e_t_sheet.html#a99ededfa6ed80849580d2b9fe797661a" title="create a new ETI_CplxTxt with one simple sub-item (ETSI_SText)">ETSheet::addBasicCplx</a>           (qreal new_x, qreal new_y)
<a name="l00175"></a>00175 {
<a name="l00176"></a>00176     <a class="code" href="class_e_t_i___cplx_txt.html" title="class representing a complex text; this may or may not represent an equation">ETI_CplxTxt</a> * new_ct = <span class="keyword">new</span> <a class="code" href="class_e_t_i___cplx_txt.html" title="class representing a complex text; this may or may not represent an equation">ETI_CplxTxt</a>(<span class="keyword">this</span>, new_x, new_y);
<a name="l00177"></a>00177 
<a name="l00178"></a>00178 
<a name="l00179"></a>00179     <span class="keywordflow">return</span> new_ct;
<a name="l00180"></a>00180 }
<a name="l00181"></a>00181 <span class="comment">/* ========================================================================= */</span>
<a name="l00182"></a>00182 
<a name="l00183"></a>00183 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00184"></a><a class="code" href="class_e_t_sheet.html#ab6ac3805d3a30ea01bfcdc50caf49b02">00184</a> <a class="code" href="class_e_t_i___cplx_txt.html" title="class representing a complex text; this may or may not represent an equation">ETI_CplxTxt</a> *   <a class="code" href="class_e_t_sheet.html#ab6ac3805d3a30ea01bfcdc50caf49b02" title="create a new ETI_CplxTxt with 3 simple sub-items (ETSI_SText), middle one being &quot;=&quot;">ETSheet::addCplx1Eq1</a>            (qreal new_x, qreal new_y)
<a name="l00185"></a>00185 {
<a name="l00186"></a>00186     <a class="code" href="class_e_t_i___cplx_txt.html" title="class representing a complex text; this may or may not represent an equation">ETI_CplxTxt</a> * new_ct = <span class="keyword">new</span> <a class="code" href="class_e_t_i___cplx_txt.html" title="class representing a complex text; this may or may not represent an equation">ETI_CplxTxt</a>(<span class="keyword">this</span>, new_x, new_y);
<a name="l00187"></a>00187 
<a name="l00188"></a>00188     <span class="keywordflow">return</span> new_ct;
<a name="l00189"></a>00189 }
<a name="l00190"></a>00190 <span class="comment">/* ========================================================================= */</span>
<a name="l00191"></a>00191 
<a name="l00192"></a>00192 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00193"></a><a class="code" href="class_e_t_sheet.html#aa00839811374c1a3db617f88cd3e9995">00193</a> <a class="code" href="class_e_t_i___m_txt.html" title="class">ETI_MTxt</a> *      <a class="code" href="class_e_t_sheet.html#aa00839811374c1a3db617f88cd3e9995" title="create a new ETI_CplxTxt with 3 simple sub-items (ETSI_SText), middle one being &quot;=&quot;">ETSheet::addMText</a>               (qreal new_x, qreal new_y)
<a name="l00194"></a>00194 {
<a name="l00195"></a>00195     <a class="code" href="class_e_t_i___m_txt.html" title="class">ETI_MTxt</a> * new_mt = <span class="keyword">new</span> <a class="code" href="class_e_t_i___m_txt.html" title="class">ETI_MTxt</a>();
<a name="l00196"></a>00196     addItem(new_mt);
<a name="l00197"></a>00197     new_mt-&gt;setPos(new_x, new_y);
<a name="l00198"></a>00198 
<a name="l00199"></a>00199     <span class="keywordflow">return</span> new_mt;
<a name="l00200"></a>00200 }
<a name="l00201"></a>00201 <span class="comment">/* ========================================================================= */</span>
<a name="l00202"></a>00202 
<a name="l00203"></a>00203 
<a name="l00204"></a>00204 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00205"></a><a class="code" href="class_e_t_sheet.html#adaf45f097cec26cb4f86270335f91aae">00205</a> QDomDocument *  <a class="code" href="class_e_t_sheet.html#adaf45f097cec26cb4f86270335f91aae" title="is capable of loading an xml file">ETSheet::openXMLFile</a>            (QString str_file_trg)
<a name="l00206"></a>00206 {
<a name="l00207"></a>00207     <span class="keywordflow">if</span> (str_file_trg.isEmpty())
<a name="l00208"></a>00208         {
<a name="l00209"></a>00209             QMessageBox::critical(
<a name="l00210"></a>00210                         <a class="code" href="main_8cc.html#ac217449d3d899f76481b08cf3cc9acc0" title="hold pointer to main gui object in global variable for easy access">g_MW</a>,
<a name="l00211"></a>00211                         QObject::tr(<span class="stringliteral">&quot;File error!!!&quot;</span>),
<a name="l00212"></a>00212                         QObject::tr(<span class="stringliteral">&quot;No source file was specified.&quot;</span>)
<a name="l00213"></a>00213                         );
<a name="l00214"></a>00214             <span class="keywordflow">return</span> <a class="code" href="aclass__ddhc_8cc.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>;
<a name="l00215"></a>00215         }
<a name="l00216"></a>00216 
<a name="l00217"></a>00217 
<a name="l00218"></a>00218     QFile xml_file(str_file_trg);
<a name="l00219"></a>00219     <span class="keywordflow">if</span> (!xml_file.exists())
<a name="l00220"></a>00220         {
<a name="l00221"></a>00221             QMessageBox::critical(
<a name="l00222"></a>00222                         <a class="code" href="main_8cc.html#ac217449d3d899f76481b08cf3cc9acc0" title="hold pointer to main gui object in global variable for easy access">g_MW</a>,
<a name="l00223"></a>00223                         QObject::tr(<span class="stringliteral">&quot;File error!!!&quot;</span>),
<a name="l00224"></a>00224                         QObject::tr(<span class="stringliteral">&quot;The file %1 does not exists.&quot;</span>)
<a name="l00225"></a>00225                         .arg(str_file_trg)
<a name="l00226"></a>00226                         );
<a name="l00227"></a>00227             <span class="keywordflow">return</span> <a class="code" href="aclass__ddhc_8cc.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>;
<a name="l00228"></a>00228         }
<a name="l00229"></a>00229 
<a name="l00230"></a>00230     <span class="keywordtype">int</span> errorLine, errorColumn;
<a name="l00231"></a>00231     QString errorMsg;
<a name="l00232"></a>00232     QDomDocument * doc_ret = <span class="keyword">new</span> QDomDocument();
<a name="l00233"></a>00233     <span class="keywordflow">if</span> (!doc_ret-&gt;setContent(&amp;xml_file, &amp;errorMsg, &amp;errorLine, &amp;errorColumn))
<a name="l00234"></a>00234         {
<a name="l00235"></a>00235             QMessageBox::critical(
<a name="l00236"></a>00236                         <a class="code" href="main_8cc.html#ac217449d3d899f76481b08cf3cc9acc0" title="hold pointer to main gui object in global variable for easy access">g_MW</a>,
<a name="l00237"></a>00237                         QObject::tr(<span class="stringliteral">&quot;File error!!!&quot;</span>),
<a name="l00238"></a>00238                         QObject::tr(<span class="stringliteral">&quot;Syntax error in file %4, line %1, column %2:\n%3&quot;</span>)
<a name="l00239"></a>00239                         .arg(errorLine)
<a name="l00240"></a>00240                         .arg(errorColumn)
<a name="l00241"></a>00241                         .arg(errorMsg)
<a name="l00242"></a>00242                         .arg(str_file_trg)
<a name="l00243"></a>00243                         );
<a name="l00244"></a>00244             <span class="keyword">delete</span> doc_ret;
<a name="l00245"></a>00245             <span class="keywordflow">return</span> <a class="code" href="aclass__ddhc_8cc.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>;
<a name="l00246"></a>00246         }
<a name="l00247"></a>00247 
<a name="l00248"></a>00248 
<a name="l00249"></a>00249     QDomElement rootElement = doc_ret-&gt;documentElement();
<a name="l00250"></a>00250     <span class="comment">//  if (rootElement.nodeType() != QDomNode::TextNode)</span>
<a name="l00251"></a>00251     <span class="comment">//  {</span>
<a name="l00252"></a>00252     <span class="comment">//      QMessageBox::critical(</span>
<a name="l00253"></a>00253     <span class="comment">//                  g_MW,</span>
<a name="l00254"></a>00254     <span class="comment">//                  QObject::tr(&quot;XML file error!!!&quot;),</span>
<a name="l00255"></a>00255     <span class="comment">//                  QObject::tr(&quot;The file %1 does not have proper format (%2).&quot;)</span>
<a name="l00256"></a>00256     <span class="comment">//                  .arg(str_file_trg)</span>
<a name="l00257"></a>00257     <span class="comment">//                  .arg(tr(&quot;root&quot;))</span>
<a name="l00258"></a>00258     <span class="comment">//                  );</span>
<a name="l00259"></a>00259     <span class="comment">//      delete doc_ret;</span>
<a name="l00260"></a>00260     <span class="comment">//      return NULL;</span>
<a name="l00261"></a>00261     <span class="comment">//  }</span>
<a name="l00262"></a>00262     <span class="keywordflow">if</span> (rootElement.tagName() != QString(<a class="code" href="_e_t_sheet_8h.html#ad9f84dcd428200f8e3f80278f9920350">XML_TAG_ROOT</a>))
<a name="l00263"></a>00263         {
<a name="l00264"></a>00264             QMessageBox::critical(
<a name="l00265"></a>00265                         <a class="code" href="main_8cc.html#ac217449d3d899f76481b08cf3cc9acc0" title="hold pointer to main gui object in global variable for easy access">g_MW</a>,
<a name="l00266"></a>00266                         QObject::tr(<span class="stringliteral">&quot;XML file error!!!&quot;</span>),
<a name="l00267"></a>00267                         QObject::tr(<span class="stringliteral">&quot;The file %1 does not have proper format (%2).&quot;</span>)
<a name="l00268"></a>00268                         .arg(str_file_trg)
<a name="l00269"></a>00269                         .arg(tr(<span class="stringliteral">&quot;marker&quot;</span>))
<a name="l00270"></a>00270                         );
<a name="l00271"></a>00271             <span class="keyword">delete</span> doc_ret;
<a name="l00272"></a>00272             <span class="keywordflow">return</span> <a class="code" href="aclass__ddhc_8cc.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>;
<a name="l00273"></a>00273         }
<a name="l00274"></a>00274 
<a name="l00275"></a>00275     <span class="keywordflow">return</span> doc_ret;
<a name="l00276"></a>00276 }
<a name="l00277"></a>00277 <span class="comment">/* ========================================================================= */</span>
<a name="l00278"></a>00278 
<a name="l00279"></a>00279 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00280"></a><a class="code" href="class_e_t_sheet.html#a17384eea523b013c593abf6be0e73623">00280</a> <span class="keywordtype">void</span>                <a class="code" href="class_e_t_sheet.html#a17384eea523b013c593abf6be0e73623" title="add the content of a xml file to current sheet">ETSheet::loadXMLFile</a>            (QString str_file_trg)
<a name="l00281"></a>00281 {
<a name="l00282"></a>00282 
<a name="l00283"></a>00283     <span class="comment">/* open the thing and get the root element */</span>
<a name="l00284"></a>00284     QDomDocument *  d_xml = <a class="code" href="class_e_t_sheet.html#adaf45f097cec26cb4f86270335f91aae" title="is capable of loading an xml file">openXMLFile</a>(str_file_trg);
<a name="l00285"></a>00285     <span class="keywordflow">if</span> (d_xml == <a class="code" href="aclass__ddhc_8cc.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>)
<a name="l00286"></a>00286         <span class="keywordflow">return</span>;
<a name="l00287"></a>00287     <span class="comment">/* the element was already checked by the openXMLFile() */</span>
<a name="l00288"></a>00288     QDomElement rootElement = d_xml-&gt;documentElement();
<a name="l00289"></a>00289 
<a name="l00290"></a>00290     QDomElement list;
<a name="l00291"></a>00291     QDomElement li_it;
<a name="l00292"></a>00292 
<a name="l00293"></a>00293     <span class="comment">/* get the list of viewports */</span>
<a name="l00294"></a>00294     list = rootElement.firstChildElement(<a class="code" href="_e_t_sheet_8h.html#ab4fa1dc7c4f4aac5c69e168fa222b0fb">XML_TAG_VP_LIST</a>);
<a name="l00295"></a>00295     <span class="keywordflow">if</span> (!list.isNull())
<a name="l00296"></a>00296         {
<a name="l00297"></a>00297             <a class="code" href="class_e_t_sheet_view.html#a239fc84997d56af6b0ef9a2ac6ff9b5b" title="loads the tree of viewports and splits from DOM element">ETSheetView::loadXML</a>(<span class="keyword">this</span>, <a class="code" href="class_e_t_sheet.html#a2ba087cbdd9779858aaa5dfea502b817" title="get associated mdi window (NULL if none)">assocMDI</a>(), list);
<a name="l00298"></a>00298         }
<a name="l00299"></a>00299     <span class="keywordflow">else</span>
<a name="l00300"></a>00300         {
<a name="l00301"></a>00301             <a class="code" href="class_e_t_sheet.html#a0ecdc80038e1ae878c6846df4c129632" title="current viewport">vp_crt</a> = <span class="keyword">new</span> <a class="code" href="class_e_t_sheet_view.html" title="Widget capable of displaying an ETSheet content.">ETSheetView</a>(<span class="keyword">this</span>, <a class="code" href="class_e_t_sheet.html#a2915c8ae289ed5b5a77ae871af964884" title="associated MDI panel">mdi_cont</a>);
<a name="l00302"></a>00302             <a class="code" href="class_e_t_sheet.html#a2915c8ae289ed5b5a77ae871af964884" title="associated MDI panel">mdi_cont</a>-&gt;setWidget(<a class="code" href="class_e_t_sheet.html#a0ecdc80038e1ae878c6846df4c129632" title="current viewport">vp_crt</a>);
<a name="l00303"></a>00303         }
<a name="l00304"></a>00304 
<a name="l00305"></a>00305     <span class="comment">/* get the list of complex texts items */</span>
<a name="l00306"></a>00306     list = rootElement.firstChildElement(<a class="code" href="_e_t_sheet_8h.html#a4141372d3d8cb73a70a68267c8848884">XML_TAG_CPLX_LIST</a>);
<a name="l00307"></a>00307     <span class="keywordflow">if</span> (!list.isNull())
<a name="l00308"></a>00308         {
<a name="l00309"></a>00309             <span class="comment">/* iterate in items */</span>
<a name="l00310"></a>00310             li_it = list.firstChildElement(<a class="code" href="_e_t_sheet_8h.html#a7f5d348661e9e65dbebb517d2922e7d0">XML_TAG_ITEM</a>);
<a name="l00311"></a>00311             <span class="keywordflow">while</span> (!li_it.isNull())
<a name="l00312"></a>00312                 {
<a name="l00313"></a>00313                     <a class="code" href="class_e_t_i___cplx_txt.html#af76d85272795dbc058c8e9ccf3395b6e" title="creates an viewport in specified sheet based on DOM node">ETI_CplxTxt::loadXML</a>(<span class="keyword">this</span>, li_it);
<a name="l00314"></a>00314                     li_it = li_it.nextSiblingElement(<a class="code" href="_e_t_sheet_8h.html#a7f5d348661e9e65dbebb517d2922e7d0">XML_TAG_ITEM</a>);
<a name="l00315"></a>00315                 }
<a name="l00316"></a>00316         }
<a name="l00317"></a>00317 
<a name="l00318"></a>00318     <span class="comment">/* get the list of formatted texts items */</span>
<a name="l00319"></a>00319     list = rootElement.firstChildElement(<a class="code" href="_e_t_sheet_8h.html#ad62d5b9175b1c43b4875729c1d8f7012">XML_TAG_FORM_LIST</a>);
<a name="l00320"></a>00320     <span class="keywordflow">if</span> (!list.isNull())
<a name="l00321"></a>00321         {
<a name="l00322"></a>00322             <span class="comment">/* iterate in items */</span>
<a name="l00323"></a>00323             li_it = list.firstChildElement(<a class="code" href="_e_t_sheet_8h.html#a7f5d348661e9e65dbebb517d2922e7d0">XML_TAG_ITEM</a>);
<a name="l00324"></a>00324             <span class="keywordflow">while</span> (!li_it.isNull())
<a name="l00325"></a>00325                 {
<a name="l00326"></a>00326                     <a class="code" href="class_e_t_i___m_txt.html#adcae33d927fbc534e7a29b11b7d485ef" title="creates an viewport in specified sheet based on DOM node">ETI_MTxt::loadXML</a>(<span class="keyword">this</span>, li_it);
<a name="l00327"></a>00327                     li_it = li_it.nextSiblingElement(<a class="code" href="_e_t_sheet_8h.html#a7f5d348661e9e65dbebb517d2922e7d0">XML_TAG_ITEM</a>);
<a name="l00328"></a>00328                 }
<a name="l00329"></a>00329         }
<a name="l00330"></a>00330 
<a name="l00331"></a>00331 }
<a name="l00332"></a>00332 <span class="comment">/* ========================================================================= */</span>
<a name="l00333"></a>00333 
<a name="l00334"></a>00334 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00335"></a><a class="code" href="class_e_t_sheet.html#a4f37965444156d4502512b3391c3c83f">00335</a> <span class="keywordtype">void</span>                <a class="code" href="class_e_t_sheet.html#a4f37965444156d4502512b3391c3c83f" title="save the content of current sheet to a xml file">ETSheet::saveXMLFile</a>            (QString str_file_trg)
<a name="l00336"></a>00336 {
<a name="l00337"></a>00337     QFile file( str_file_trg );
<a name="l00338"></a>00338     <span class="keywordflow">if</span>( file.open( QFile::WriteOnly ) )
<a name="l00339"></a>00339         {
<a name="l00340"></a>00340             QDomDocument doc_xml(<a class="code" href="_e_t_sheet_8h.html#ad9f84dcd428200f8e3f80278f9920350">XML_TAG_ROOT</a>);
<a name="l00341"></a>00341 
<a name="l00342"></a>00342             QDomElement root = doc_xml.createElement(<a class="code" href="_e_t_sheet_8h.html#ad9f84dcd428200f8e3f80278f9920350">XML_TAG_ROOT</a>);
<a name="l00343"></a>00343             doc_xml.appendChild(root);
<a name="l00344"></a>00344 
<a name="l00345"></a>00345             QDomElement list;
<a name="l00346"></a>00346 
<a name="l00347"></a>00347             <span class="comment">/* the list of viewports */</span>
<a name="l00348"></a>00348             list = doc_xml.createElement(<a class="code" href="_e_t_sheet_8h.html#ab4fa1dc7c4f4aac5c69e168fa222b0fb">XML_TAG_VP_LIST</a>);
<a name="l00349"></a>00349             root.appendChild(list);
<a name="l00350"></a>00350             <a class="code" href="class_e_t_sheet_view.html#ad511334ff3565031a0d64c08ca2a01b7" title="saves the defining elements of the viewports in a sheet to DOM element">ETSheetView::saveXML</a>(<span class="keyword">this</span>, list);
<a name="l00351"></a>00351 
<a name="l00352"></a>00352             <span class="comment">/* the list of items */</span>
<a name="l00353"></a>00353             QDomElement list_cplx = doc_xml.createElement(<a class="code" href="_e_t_sheet_8h.html#a4141372d3d8cb73a70a68267c8848884">XML_TAG_CPLX_LIST</a>);
<a name="l00354"></a>00354             root.appendChild(list_cplx);
<a name="l00355"></a>00355             QDomElement list_mtxt = doc_xml.createElement(<a class="code" href="_e_t_sheet_8h.html#ad62d5b9175b1c43b4875729c1d8f7012">XML_TAG_FORM_LIST</a>);
<a name="l00356"></a>00356             root.appendChild(list_mtxt);
<a name="l00357"></a>00357             QDomElement list_it;
<a name="l00358"></a>00358 
<a name="l00359"></a>00359             QList&lt;QGraphicsItem *&gt;  it_l = items();
<a name="l00360"></a>00360             <span class="keywordflow">foreach</span> (QGraphicsItem * iter_i, it_l) {
<a name="l00361"></a>00361                 <span class="keywordflow">if</span> (iter_i-&gt;type() == <a class="code" href="class_e_t_i___cplx_txt.html#a2f46f6eeab5260fc70f920c4525cdc1fa167d4126131c151b8d374d1a1fe960f7">ETI_CplxTxt::Type</a>)
<a name="l00362"></a>00362                     {
<a name="l00363"></a>00363                         list_it = doc_xml.createElement(<a class="code" href="_e_t_sheet_8h.html#a7f5d348661e9e65dbebb517d2922e7d0">XML_TAG_ITEM</a>);
<a name="l00364"></a>00364                         list_cplx.appendChild(list_it);
<a name="l00365"></a>00365                         <span class="keyword">static_cast&lt;</span><a class="code" href="class_e_t_i___cplx_txt.html" title="class representing a complex text; this may or may not represent an equation">ETI_CplxTxt</a>*<span class="keyword">&gt;</span>(iter_i)-&gt;saveXML(list_it);
<a name="l00366"></a>00366                     }
<a name="l00367"></a>00367                 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (iter_i-&gt;type() == ETI_MTxt::Type)
<a name="l00368"></a>00368                     {
<a name="l00369"></a>00369                         list_it = doc_xml.createElement(<a class="code" href="_e_t_sheet_8h.html#a7f5d348661e9e65dbebb517d2922e7d0">XML_TAG_ITEM</a>);
<a name="l00370"></a>00370                         list_mtxt.appendChild(list_it);
<a name="l00371"></a>00371                         <span class="keyword">static_cast&lt;</span><a class="code" href="class_e_t_i___cplx_txt.html" title="class representing a complex text; this may or may not represent an equation">ETI_CplxTxt</a>*<span class="keyword">&gt;</span>(iter_i)-&gt;saveXML(list_it);
<a name="l00372"></a>00372                     }
<a name="l00373"></a>00373                 <span class="keywordflow">else</span>
<a name="l00374"></a>00374                     {
<a name="l00375"></a>00375                         qDebug() &lt;&lt; <span class="stringliteral">&quot;An item was found in scene that match no &quot;</span>
<a name="l00376"></a>00376                                  &lt;&lt; <span class="stringliteral">&quot;type that we know of and will not be saved&quot;</span>;
<a name="l00377"></a>00377                         qDebug() &lt;&lt; <span class="stringliteral">&quot;The item: &quot;</span> &lt;&lt; iter_i;
<a name="l00378"></a>00378                     }
<a name="l00379"></a>00379             }
<a name="l00380"></a>00380 
<a name="l00381"></a>00381 
<a name="l00382"></a>00382             QTextStream out(&amp;file);
<a name="l00383"></a>00383             QApplication::setOverrideCursor(Qt::WaitCursor);
<a name="l00384"></a>00384             out &lt;&lt; doc_xml.toString();
<a name="l00385"></a>00385             QApplication::restoreOverrideCursor();
<a name="l00386"></a>00386 
<a name="l00387"></a>00387         }
<a name="l00388"></a>00388     <span class="keywordflow">else</span>
<a name="l00389"></a>00389         {
<a name="l00390"></a>00390             QMessageBox::critical(
<a name="l00391"></a>00391                         <a class="code" href="main_8cc.html#ac217449d3d899f76481b08cf3cc9acc0" title="hold pointer to main gui object in global variable for easy access">g_MW</a>,
<a name="l00392"></a>00392                         QObject::tr(<span class="stringliteral">&quot;XML file error!!!&quot;</span>),
<a name="l00393"></a>00393                         QObject::tr(<span class="stringliteral">&quot;The file %1 Could not be created / opened.&quot;</span>)
<a name="l00394"></a>00394                         .arg(str_file_trg)
<a name="l00395"></a>00395                         );
<a name="l00396"></a>00396         }
<a name="l00397"></a>00397 }
<a name="l00398"></a>00398 <span class="comment">/* ========================================================================= */</span>
<a name="l00399"></a>00399 
<a name="l00400"></a>00400 
<a name="l00401"></a>00401 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00402"></a><a class="code" href="class_e_t_sheet.html#a290549c5a6aba1b5f1f9c5dd8da1584f">00402</a> <span class="keywordtype">void</span>                <a class="code" href="class_e_t_sheet.html#a290549c5a6aba1b5f1f9c5dd8da1584f" title="load common properties of a QGraphicsItem from a dox node">ETSheet::loadQICommon</a>       (
<a name="l00403"></a>00403     QGraphicsItem * dest, QDomElement dom_e )
<a name="l00404"></a>00404 {
<a name="l00405"></a>00405     <span class="comment">/* we are provided by the caller with the &quot;common&quot; element */</span>
<a name="l00406"></a>00406     QDomElement dom_it;
<a name="l00407"></a>00407     QDomElement dom_sit;
<a name="l00408"></a>00408     <span class="keywordtype">bool</span> b_ok = <span class="keyword">false</span>;
<a name="l00409"></a>00409 
<a name="l00410"></a>00410     <span class="comment">/* the position */</span>
<a name="l00411"></a>00411     dom_it = dom_e.firstChildElement(<a class="code" href="_e_t_sheet_8h.html#a35ec438f960747e5ed2b96677fe1fa56">XML_TAG_POS</a>);
<a name="l00412"></a>00412     <span class="keywordflow">if</span> (!dom_it.isNull())
<a name="l00413"></a>00413         {
<a name="l00414"></a>00414 
<a name="l00415"></a>00415 
<a name="l00416"></a>00416             <span class="comment">/* set the placement of this item inside the scene */</span>
<a name="l00417"></a>00417             QPointF new_pos(0, 0);
<a name="l00418"></a>00418             <span class="keywordflow">for</span> (;;)
<a name="l00419"></a>00419                 {
<a name="l00420"></a>00420                     <span class="comment">/* x component */</span>
<a name="l00421"></a>00421                     dom_sit = dom_it.firstChildElement(<a class="code" href="_e_t_sheet_8h.html#af0866489c168e1899095869e1dafe62f">XML_TAG_X</a>);
<a name="l00422"></a>00422                     <span class="keywordflow">if</span> (!dom_sit.isNull())
<a name="l00423"></a>00423                         {
<a name="l00424"></a>00424                             new_pos.setX(dom_sit.text().toDouble(&amp;b_ok));
<a name="l00425"></a>00425                             <span class="keywordflow">if</span> (!b_ok)
<a name="l00426"></a>00426                                 {
<a name="l00427"></a>00427                                     qDebug() &lt;&lt; <span class="stringliteral">&quot;The input presented an X component (&quot;</span>
<a name="l00428"></a>00428                                              &lt;&lt; dom_sit.text() &lt;&lt; <span class="stringliteral">&quot;) but it could not be &quot;</span>
<a name="l00429"></a>00429                                              &lt;&lt; <span class="stringliteral">&quot;parsed into a valid real number.&quot;</span>;
<a name="l00430"></a>00430                                     <span class="keywordflow">break</span>;
<a name="l00431"></a>00431                                 }
<a name="l00432"></a>00432 
<a name="l00433"></a>00433                             <span class="keywordflow">if</span> (!dom_it.nextSiblingElement(<a class="code" href="_e_t_sheet_8h.html#af0866489c168e1899095869e1dafe62f">XML_TAG_X</a>).isNull())
<a name="l00434"></a>00434                                 {
<a name="l00435"></a>00435                                     qDebug() &lt;&lt; <span class="stringliteral">&quot;The input presented more than one &quot;</span>
<a name="l00436"></a>00436                                              &lt;&lt; <a class="code" href="_e_t_sheet_8h.html#af0866489c168e1899095869e1dafe62f">XML_TAG_X</a> &lt;&lt; <span class="stringliteral">&quot; tags, when only &quot;</span>
<a name="l00437"></a>00437                                              &lt;&lt; <span class="stringliteral">&quot;one per ETI_CplxTxt element is allowed&quot;</span>;
<a name="l00438"></a>00438                                 }
<a name="l00439"></a>00439                         }
<a name="l00440"></a>00440 
<a name="l00441"></a>00441 
<a name="l00442"></a>00442                     <span class="comment">/* y component */</span>
<a name="l00443"></a>00443                     dom_sit = dom_it.firstChildElement(<a class="code" href="_e_t_sheet_8h.html#ae93bce2d4f2bf25161520d842ca1cb2b">XML_TAG_Y</a>);
<a name="l00444"></a>00444                     <span class="keywordflow">if</span> (!dom_sit.isNull())
<a name="l00445"></a>00445                         {
<a name="l00446"></a>00446 
<a name="l00447"></a>00447                             new_pos.setY(dom_sit.text().toDouble(&amp;b_ok));
<a name="l00448"></a>00448                             <span class="keywordflow">if</span> (!b_ok)
<a name="l00449"></a>00449                                 {
<a name="l00450"></a>00450                                     qDebug() &lt;&lt; <span class="stringliteral">&quot;The input presented an Y component (&quot;</span>
<a name="l00451"></a>00451                                              &lt;&lt; dom_sit.text() &lt;&lt; <span class="stringliteral">&quot;) but it could not be &quot;</span>
<a name="l00452"></a>00452                                              &lt;&lt; <span class="stringliteral">&quot;parsed into a valid real number.&quot;</span>;
<a name="l00453"></a>00453                                     new_pos.setX(0.0);
<a name="l00454"></a>00454                                     <span class="keywordflow">break</span>;
<a name="l00455"></a>00455                                 }
<a name="l00456"></a>00456 
<a name="l00457"></a>00457                             <span class="keywordflow">if</span> (!dom_it.nextSiblingElement(<a class="code" href="_e_t_sheet_8h.html#ae93bce2d4f2bf25161520d842ca1cb2b">XML_TAG_Y</a>).isNull())
<a name="l00458"></a>00458                                 {
<a name="l00459"></a>00459                                     qDebug() &lt;&lt; <span class="stringliteral">&quot;The input presented more than one &quot;</span>
<a name="l00460"></a>00460                                              &lt;&lt; <a class="code" href="_e_t_sheet_8h.html#ae93bce2d4f2bf25161520d842ca1cb2b">XML_TAG_Y</a> &lt;&lt; <span class="stringliteral">&quot; tags, when only &quot;</span>
<a name="l00461"></a>00461                                              &lt;&lt; <span class="stringliteral">&quot;one per ETI_CplxTxt element is allowed&quot;</span>;
<a name="l00462"></a>00462                                 }
<a name="l00463"></a>00463                         }
<a name="l00464"></a>00464 
<a name="l00465"></a>00465                     <span class="keywordflow">break</span>;
<a name="l00466"></a>00466                 }
<a name="l00467"></a>00467             dest-&gt;setPos(new_pos);
<a name="l00468"></a>00468 
<a name="l00469"></a>00469 
<a name="l00470"></a>00470 
<a name="l00471"></a>00471             <span class="comment">/* check for other &quot;position&quot; tags */</span>
<a name="l00472"></a>00472             <span class="keywordflow">if</span> (!dom_it.nextSiblingElement(<a class="code" href="_e_t_sheet_8h.html#a35ec438f960747e5ed2b96677fe1fa56">XML_TAG_POS</a>).isNull())
<a name="l00473"></a>00473                 {
<a name="l00474"></a>00474                     qDebug() &lt;&lt; <span class="stringliteral">&quot;The input presented more than one &quot;</span>
<a name="l00475"></a>00475                              &lt;&lt; <a class="code" href="_e_t_sheet_8h.html#a35ec438f960747e5ed2b96677fe1fa56">XML_TAG_POS</a> &lt;&lt; <span class="stringliteral">&quot; tags, when only &quot;</span>
<a name="l00476"></a>00476                              &lt;&lt; <span class="stringliteral">&quot;one per ETI_CplxTxt element is allowed&quot;</span>;
<a name="l00477"></a>00477                 }
<a name="l00478"></a>00478         }
<a name="l00479"></a>00479 
<a name="l00480"></a>00480 
<a name="l00481"></a>00481 }
<a name="l00482"></a>00482 <span class="comment">/* ========================================================================= */</span>
<a name="l00483"></a>00483 
<a name="l00484"></a>00484 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00485"></a><a class="code" href="class_e_t_sheet.html#ab66f954ab58258d7eae54feb21081c16">00485</a> <span class="keywordtype">void</span>                <a class="code" href="class_e_t_sheet.html#ab66f954ab58258d7eae54feb21081c16" title="save common properties of a QGraphicsItem from a dox node">ETSheet::saveQICommon</a>       (
<a name="l00486"></a>00486     QGraphicsItem * dest, QDomElement dom_e )
<a name="l00487"></a>00487 {
<a name="l00488"></a>00488 
<a name="l00489"></a>00489     <span class="comment">/*      position */</span>
<a name="l00490"></a>00490     QDomElement dom_it2 = dom_e.ownerDocument().createElement(<a class="code" href="_e_t_sheet_8h.html#a35ec438f960747e5ed2b96677fe1fa56">XML_TAG_POS</a>);
<a name="l00491"></a>00491     dom_e.appendChild(dom_it2);
<a name="l00492"></a>00492 
<a name="l00493"></a>00493     <span class="comment">/*          X */</span>
<a name="l00494"></a>00494     QDomElement dom_it3 = dom_e.ownerDocument().createElement(<a class="code" href="_e_t_sheet_8h.html#af0866489c168e1899095869e1dafe62f">XML_TAG_X</a>);
<a name="l00495"></a>00495     dom_it2.appendChild(dom_it3);
<a name="l00496"></a>00496     QDomText dom_tx = dom_e.ownerDocument()
<a name="l00497"></a>00497             .createTextNode(QString(<span class="stringliteral">&quot;%1&quot;</span>).arg(dest-&gt;pos().x()));
<a name="l00498"></a>00498     dom_it3.appendChild(dom_tx);
<a name="l00499"></a>00499 
<a name="l00500"></a>00500     <span class="comment">/*          Y */</span>
<a name="l00501"></a>00501     dom_it3 = dom_e.ownerDocument().createElement(<a class="code" href="_e_t_sheet_8h.html#ae93bce2d4f2bf25161520d842ca1cb2b">XML_TAG_Y</a>);
<a name="l00502"></a>00502     dom_it2.appendChild(dom_it3);
<a name="l00503"></a>00503     dom_tx = dom_e.ownerDocument()
<a name="l00504"></a>00504             .createTextNode(QString(<span class="stringliteral">&quot;%1&quot;</span>).arg(dest-&gt;pos().y()));
<a name="l00505"></a>00505     dom_it3.appendChild(dom_tx);
<a name="l00506"></a>00506 
<a name="l00507"></a>00507 }
<a name="l00508"></a>00508 <span class="comment">/* ========================================================================= */</span>
<a name="l00509"></a>00509 
<a name="l00510"></a>00510 
<a name="l00511"></a>00511 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00512"></a><a class="code" href="class_e_t_sheet.html#a4b9c76466085e8de5a98ba880c81b82e">00512</a> <span class="keywordtype">void</span>                <a class="code" href="class_e_t_sheet.html#a4b9c76466085e8de5a98ba880c81b82e" title="Remove all splits; Only a viewport remains.">ETSheet::vp_DelAll</a>              ( <span class="keywordtype">void</span> )
<a name="l00513"></a>00513 {
<a name="l00514"></a>00514     <span class="keywordflow">if</span> (<a class="code" href="class_e_t_sheet.html#a0ecdc80038e1ae878c6846df4c129632" title="current viewport">vp_crt</a> != <a class="code" href="aclass__ddhc_8cc.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>)
<a name="l00515"></a>00515         {
<a name="l00516"></a>00516             <span class="keywordflow">if</span> (<a class="code" href="class_e_t_sheet.html#a0ecdc80038e1ae878c6846df4c129632" title="current viewport">vp_crt</a>-&gt;parent() == <span class="keyword">this</span>)
<a name="l00517"></a>00517                 { <span class="comment">/* top level */</span>
<a name="l00518"></a>00518                     QMessageBox::warning(<a class="code" href="class_e_t_sheet.html#a2ba087cbdd9779858aaa5dfea502b817" title="get associated mdi window (NULL if none)">assocMDI</a>(), tr(<span class="stringliteral">&quot;Error&quot;</span>),
<a name="l00519"></a>00519                                          tr(<span class="stringliteral">&quot;No split to delete&quot;</span>));
<a name="l00520"></a>00520                     <span class="keywordflow">return</span>;
<a name="l00521"></a>00521                 }
<a name="l00522"></a>00522 
<a name="l00523"></a>00523             <a class="code" href="class_e_t_sheet.html#a0ecdc80038e1ae878c6846df4c129632" title="current viewport">vp_crt</a>-&gt;setParent(<a class="code" href="class_e_t_sheet.html#a2ba087cbdd9779858aaa5dfea502b817" title="get associated mdi window (NULL if none)">assocMDI</a>());
<a name="l00524"></a>00524             <a class="code" href="class_e_t_sheet.html#a2ba087cbdd9779858aaa5dfea502b817" title="get associated mdi window (NULL if none)">assocMDI</a>()-&gt;widget()-&gt;close();
<a name="l00525"></a>00525             <a class="code" href="class_e_t_sheet.html#a2ba087cbdd9779858aaa5dfea502b817" title="get associated mdi window (NULL if none)">assocMDI</a>()-&gt;widget()-&gt;deleteLater();
<a name="l00526"></a>00526             <a class="code" href="class_e_t_sheet.html#a2ba087cbdd9779858aaa5dfea502b817" title="get associated mdi window (NULL if none)">assocMDI</a>()-&gt;setWidget(<a class="code" href="class_e_t_sheet.html#a0ecdc80038e1ae878c6846df4c129632" title="current viewport">vp_crt</a>);
<a name="l00527"></a>00527             <a class="code" href="class_e_t_sheet.html#a0ecdc80038e1ae878c6846df4c129632" title="current viewport">vp_crt</a>-&gt;show();
<a name="l00528"></a>00528         }
<a name="l00529"></a>00529 }
<a name="l00530"></a>00530 <span class="comment">/* ========================================================================= */</span>
<a name="l00531"></a>00531 
<a name="l00532"></a>00532 
<a name="l00533"></a>00533 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00534"></a><a class="code" href="class_e_t_sheet.html#ac312505aeb246d67fcdb114e9b459c35">00534</a> <span class="keywordtype">void</span>                <a class="code" href="class_e_t_sheet.html#ac312505aeb246d67fcdb114e9b459c35" title="zoom in on current viewport">ETSheet::vp_ZoomIn</a>              ( <span class="keywordtype">void</span> )
<a name="l00535"></a>00535 {
<a name="l00536"></a>00536     <span class="keywordflow">if</span> (<a class="code" href="class_e_t_sheet.html#a0ecdc80038e1ae878c6846df4c129632" title="current viewport">vp_crt</a> != <a class="code" href="aclass__ddhc_8cc.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>)
<a name="l00537"></a>00537         {
<a name="l00538"></a>00538             <a class="code" href="class_e_t_sheet.html#a0ecdc80038e1ae878c6846df4c129632" title="current viewport">vp_crt</a>-&gt;<a class="code" href="class_e_t_sheet_view.html#af4696c2081d49d2dcf6e6dab5b5f2c40" title="uses provided factor to change the scale, making texts larger">zoomIn</a>();
<a name="l00539"></a>00539         }
<a name="l00540"></a>00540 }
<a name="l00541"></a>00541 <span class="comment">/* ========================================================================= */</span>
<a name="l00542"></a>00542 
<a name="l00543"></a>00543 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00544"></a><a class="code" href="class_e_t_sheet.html#a4240be69d4b31c91347a5d9200d74d66">00544</a> <span class="keywordtype">void</span>                <a class="code" href="class_e_t_sheet.html#a4240be69d4b31c91347a5d9200d74d66" title="zoom out on current viewport">ETSheet::vp_ZoomOut</a>             ( <span class="keywordtype">void</span> )
<a name="l00545"></a>00545 {
<a name="l00546"></a>00546     <span class="keywordflow">if</span> (<a class="code" href="class_e_t_sheet.html#a0ecdc80038e1ae878c6846df4c129632" title="current viewport">vp_crt</a> != <a class="code" href="aclass__ddhc_8cc.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>)
<a name="l00547"></a>00547         {
<a name="l00548"></a>00548             <a class="code" href="class_e_t_sheet.html#a0ecdc80038e1ae878c6846df4c129632" title="current viewport">vp_crt</a>-&gt;<a class="code" href="class_e_t_sheet_view.html#ab2418e2354197a47d5d5137878e741c2" title="uses provided factor&#39;s inverse (1/n) to change the scale, making texts smaller">zoomOut</a>();
<a name="l00549"></a>00549         }
<a name="l00550"></a>00550 }
<a name="l00551"></a>00551 <span class="comment">/* ========================================================================= */</span>
<a name="l00552"></a>00552 
<a name="l00553"></a>00553 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00554"></a><a class="code" href="class_e_t_sheet.html#ae8f7cdef6c178db853483cbdcb9039e2">00554</a> <span class="keywordtype">void</span>                <a class="code" href="class_e_t_sheet.html#ae8f7cdef6c178db853483cbdcb9039e2" title="rotate the view clockwise on current viewport">ETSheet::vp_RotClk</a>              ( <span class="keywordtype">void</span> )
<a name="l00555"></a>00555 {
<a name="l00556"></a>00556     <span class="keywordflow">if</span> (<a class="code" href="class_e_t_sheet.html#a0ecdc80038e1ae878c6846df4c129632" title="current viewport">vp_crt</a> != <a class="code" href="aclass__ddhc_8cc.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>)
<a name="l00557"></a>00557         {
<a name="l00558"></a>00558             <a class="code" href="class_e_t_sheet.html#a0ecdc80038e1ae878c6846df4c129632" title="current viewport">vp_crt</a>-&gt;<a class="code" href="class_e_t_sheet_view.html#a7f0a6edc211ffccd10b003289d7200ca" title="change display angle, using the argument">rotateRight</a>();
<a name="l00559"></a>00559         }
<a name="l00560"></a>00560 }
<a name="l00561"></a>00561 <span class="comment">/* ========================================================================= */</span>
<a name="l00562"></a>00562 
<a name="l00563"></a>00563 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00564"></a><a class="code" href="class_e_t_sheet.html#ab5146b7fc1476a2722362f10787dfaef">00564</a> <span class="keywordtype">void</span>                <a class="code" href="class_e_t_sheet.html#ab5146b7fc1476a2722362f10787dfaef" title="rotate the view counter-clockwise on current viewport">ETSheet::vp_RotCtrClk</a>               ( <span class="keywordtype">void</span> )
<a name="l00565"></a>00565 {
<a name="l00566"></a>00566     <span class="keywordflow">if</span> (<a class="code" href="class_e_t_sheet.html#a0ecdc80038e1ae878c6846df4c129632" title="current viewport">vp_crt</a> != <a class="code" href="aclass__ddhc_8cc.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>)
<a name="l00567"></a>00567         {
<a name="l00568"></a>00568             <a class="code" href="class_e_t_sheet.html#a0ecdc80038e1ae878c6846df4c129632" title="current viewport">vp_crt</a>-&gt;<a class="code" href="class_e_t_sheet_view.html#afbef86a2ebd7e22758d3e3a81b887187" title="change display angle, using the negative of the argument">rotateLeft</a>();
<a name="l00569"></a>00569         }
<a name="l00570"></a>00570 }
<a name="l00571"></a>00571 <span class="comment">/* ========================================================================= */</span>
<a name="l00572"></a>00572 
<a name="l00573"></a>00573 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00574"></a><a class="code" href="class_e_t_sheet.html#ac7cc9b89ecb5a36a9c7a6c3a7febeed7">00574</a> QWidget *           <a class="code" href="class_e_t_sheet.html#ac7cc9b89ecb5a36a9c7a6c3a7febeed7" title="gets the top vidget and tells if it&#39;s a viewport or splitter">ETSheet::vp_TopWidget</a>               (<span class="keywordtype">bool</span> * b_is_viewport)
<a name="l00575"></a>00575 {
<a name="l00576"></a>00576     <span class="keywordflow">if</span> (<a class="code" href="class_e_t_sheet.html#a2915c8ae289ed5b5a77ae871af964884" title="associated MDI panel">mdi_cont</a> == <a class="code" href="aclass__ddhc_8cc.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>)
<a name="l00577"></a>00577         <span class="keywordflow">return</span> <a class="code" href="aclass__ddhc_8cc.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>;
<a name="l00578"></a>00578 
<a name="l00579"></a>00579     <span class="comment">/* if there is a splitter then it&#39;s top level */</span>
<a name="l00580"></a>00580     QSplitter * splt = <a class="code" href="class_e_t_sheet.html#a2915c8ae289ed5b5a77ae871af964884" title="associated MDI panel">mdi_cont</a>-&gt;findChild&lt;QSplitter *&gt;();
<a name="l00581"></a>00581     <span class="keywordflow">if</span> (splt == <a class="code" href="aclass__ddhc_8cc.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>)
<a name="l00582"></a>00582         {
<a name="l00583"></a>00583             *b_is_viewport = <span class="keyword">true</span>;
<a name="l00584"></a>00584             <span class="keywordflow">return</span> <a class="code" href="class_e_t_sheet.html#a2915c8ae289ed5b5a77ae871af964884" title="associated MDI panel">mdi_cont</a>-&gt;findChild&lt;QGraphicsView *&gt;();
<a name="l00585"></a>00585         }
<a name="l00586"></a>00586     *b_is_viewport = <span class="keyword">false</span>;
<a name="l00587"></a>00587     <span class="keywordflow">return</span> splt;
<a name="l00588"></a>00588 
<a name="l00589"></a>00589 }
<a name="l00590"></a>00590 <span class="comment">/* ========================================================================= */</span>
<a name="l00591"></a>00591 
<a name="l00592"></a>00592 
<a name="l00593"></a>00593 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00594"></a><a class="code" href="class_e_t_sheet.html#a268f805202701c67e7334201965bf4c3">00594</a> <span class="keywordtype">void</span>                <a class="code" href="class_e_t_sheet.html#a268f805202701c67e7334201965bf4c3" title="tell which is current viewport (should never be null)">ETSheet::setCurrentVp</a>               ( <a class="code" href="class_e_t_sheet_view.html" title="Widget capable of displaying an ETSheet content.">ETSheetView</a> * new_vp )
<a name="l00595"></a>00595 {
<a name="l00596"></a>00596     <span class="keywordflow">if</span> (<a class="code" href="class_e_t_sheet.html#a2915c8ae289ed5b5a77ae871af964884" title="associated MDI panel">mdi_cont</a> == <a class="code" href="aclass__ddhc_8cc.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>)
<a name="l00597"></a>00597         <span class="keywordflow">return</span>;
<a name="l00598"></a>00598 
<a name="l00599"></a>00599     <span class="keywordflow">if</span> (<a class="code" href="class_e_t_sheet.html#a0ecdc80038e1ae878c6846df4c129632" title="current viewport">vp_crt</a> != <a class="code" href="aclass__ddhc_8cc.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>)
<a name="l00600"></a>00600         {
<a name="l00601"></a>00601             <a class="code" href="class_e_t_sheet_view.html" title="Widget capable of displaying an ETSheet content.">ETSheetView</a> * old = <a class="code" href="class_e_t_sheet.html#a0ecdc80038e1ae878c6846df4c129632" title="current viewport">vp_crt</a>;
<a name="l00602"></a>00602             <a class="code" href="class_e_t_sheet.html#a0ecdc80038e1ae878c6846df4c129632" title="current viewport">vp_crt</a> = <a class="code" href="aclass__ddhc_8cc.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>;
<a name="l00603"></a>00603             old-&gt;resetCachedContent();
<a name="l00604"></a>00604         }
<a name="l00605"></a>00605     <a class="code" href="class_e_t_sheet.html#a0ecdc80038e1ae878c6846df4c129632" title="current viewport">vp_crt</a> = new_vp;
<a name="l00606"></a>00606     <span class="keywordflow">if</span> (<a class="code" href="class_e_t_sheet.html#a0ecdc80038e1ae878c6846df4c129632" title="current viewport">vp_crt</a> != <a class="code" href="aclass__ddhc_8cc.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>)
<a name="l00607"></a>00607         {
<a name="l00608"></a>00608             <a class="code" href="class_e_t_sheet.html#a0ecdc80038e1ae878c6846df4c129632" title="current viewport">vp_crt</a>-&gt;resetCachedContent();
<a name="l00609"></a>00609         }
<a name="l00610"></a>00610 
<a name="l00611"></a>00611 }
<a name="l00612"></a>00612 <span class="comment">/* ========================================================================= */</span>
<a name="l00613"></a>00613 
<a name="l00614"></a>00614 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00615"></a><a class="code" href="class_e_t_sheet.html#a4216d12a4fe36d9dfd3a8bc36be83f79">00615</a> <span class="keywordtype">void</span>                <a class="code" href="class_e_t_sheet.html#a4216d12a4fe36d9dfd3a8bc36be83f79" title="change the color used for active viewport&#39;s background">ETSheet::setBackground</a>              (QColor new_col)
<a name="l00616"></a>00616 {
<a name="l00617"></a>00617     <a class="code" href="class_e_t_sheet.html#ab44474e67d557f2233aa597544d957f7" title="the background color for this sheet">back_col</a> = new_col;
<a name="l00618"></a>00618     <span class="keywordflow">if</span> (<a class="code" href="class_e_t_sheet.html#a0ecdc80038e1ae878c6846df4c129632" title="current viewport">vp_crt</a> != <a class="code" href="aclass__ddhc_8cc.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>)
<a name="l00619"></a>00619         {
<a name="l00620"></a>00620             <a class="code" href="class_e_t_sheet.html#a0ecdc80038e1ae878c6846df4c129632" title="current viewport">vp_crt</a>-&gt;update();
<a name="l00621"></a>00621         }
<a name="l00622"></a>00622 }
<a name="l00623"></a>00623 <span class="comment">/* ========================================================================= */</span>
<a name="l00624"></a>00624 
<a name="l00625"></a>00625 
<a name="l00626"></a>00626 <span class="comment">/*  CLASS    =============================================================== */</span>
<a name="l00627"></a>00627 <span class="comment">//</span>
<a name="l00628"></a>00628 <span class="comment">//</span>
<a name="l00629"></a>00629 <span class="comment">//</span>
<a name="l00630"></a>00630 <span class="comment">//</span>
<a name="l00631"></a>00631 <span class="comment">/* ------------------------------------------------------------------------- */</span>
<a name="l00632"></a>00632 <span class="comment">/* ========================================================================= */</span>
</pre></div></div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="_e_t_sheet_8cc.html">ETSheet.cc</a>      </li>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

    <li class="footer">Generated on Sun Oct 23 2011 22:06:47 for EquTemper by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </li>
   </ul>
 </div>
</body>
</html>
